The following example demonstrates how to sort the data items in an ascending direction according to the values of the ShipCountry column.

XAML
Copy Code
<Grid xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
      xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">
  <Grid.Resources>
    <xcdg:DataGridCollectionViewSource x:Key="cvs_orders"
                                     Source="{Binding Source={x:Static Application.Current},
                                                       Path=Orders}">
     <xcdg:DataGridCollectionViewSource.SortDescriptions>
       <scm:SortDescription PropertyName="ShipCountry" Direction="Ascending"/>
     </xcdg:DataGridCollectionViewSource.SortDescriptions>
    </xcdg:DataGridCollectionViewSource>          
  </Grid.Resources>
  <xcdg:DataGridControl x:Name="OrdersGrid"
                        ItemsSource="{Binding Source={StaticResource cvs_orders}}">
    <xcdg:DataGridControl.Columns>
      <xcdg:Column FieldName="ShipCountry" VisiblePosition="0"/>
    </xcdg:DataGridControl.Columns>
  </xcdg:DataGridControl>
</Grid>
VB.NET
Copy Code
Dim collectionView As New DataGridCollectionView( Orders )
collectionView.SortDescriptions.Add( New SortDescription( "ShipCountry", ListSortDirection.Ascending ) )
dataGridControl.ItemsSource = collectionView
dataGridControl.Columns( "ShipCountry" ).VisiblePosition = 0
C#
Copy Code
DataGridCollectionView collectionView = new DataGridCollectionView( Orders );
collectionView.SortDescriptions.Add( new SortDescription( "ShipCountry", ListSortDirection.Ascending ) );
dataGridControl.ItemsSource = collectionView;
dataGridControl.Columns[ "ShipCountry" ].VisiblePosition = 0;